package com.zmc.member.infrastructure.component.collection.impl;

import com.zmc.common.utils.PageUtils;
import com.zmc.member.infrastructure.bean.query.MyCollectionQuery;
import com.zmc.member.infrastructure.bean.vo.MyCollectionVo;
import com.zmc.member.infrastructure.component.collection.MyCollectionStrategyService;
import com.zmc.member.infrastructure.service.MemberCollectService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;


/**
 * @Author：zmc
 * @Date：2025/5/27 11:25
 */
@Component
public class MyCollectionPersistenceServiceImpl implements MyCollectionStrategyService {

    @Autowired
    private MemberCollectService memberCollectService;



    @Override
    public PageUtils pageList(MyCollectionQuery query) {
        return memberCollectService.queryPage(query);
    }

    @Override
    public void save(MyCollectionVo vo) {
        memberCollectService.saveBySku(vo.getSkuId());
    }

    @Override
    public void remove(MyCollectionVo vo) {
        memberCollectService.removeBySku(vo.getSkuId());
    }

    @Override
    public boolean contains(String skuId) {
        return memberCollectService.containsSku(skuId);
    }
}
